home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / utilities / comsuite 95 / COMMSUIT / ATTMAIL.C_ / ATTMAIL.C
Encoding:
C/C++ Source or Header  |  1993-09-13  |  1.8 KB  |  59 lines

  1. /* This program attmail.c created by Delrina and assigned to the attmail session*/
  2. /* runs an automated logon script for connecting to AT&T Mail.                    */
  3.  
  4. /*    $Revision:   1.2  $  */
  5. /*    $Date:   27 Oct 1995 14:42:48  $  */
  6.  
  7. /* Define main function, which is always the starting point of C programs. */
  8. /* (The term "void" indicates that the function returns no value.) */
  9. void main()
  10.     {
  11.     /* Declare variables */
  12.     long ScriptHandle;
  13.     int ReturnValue;
  14.     char Buffer[128];
  15.  
  16.     /* Initialize variables */
  17.     ReturnValue = 0;
  18.     ScriptHandle = 0;
  19.  
  20.     /* Establish a link between this script program and Delrina WinComm PRO */
  21.     ScriptHandle = dcInitialize(0,0,0,0);
  22.  
  23.     /* Exit if intialization of link with Delrina WinComm PRO failed */
  24.     if (ScriptHandle == 0) exit();
  25.         
  26.     /* Type two consecutive <Enter> with pauses */
  27.     dcSleep(ScriptHandle, 2197L);
  28.     dcTypeText(ScriptHandle, 0, "\r");
  29.     dcSleep(ScriptHandle, 494L);
  30.     dcTypeText(ScriptHandle, 0, "\r");
  31.  
  32.     /* Wait for a prompt */
  33.     ReturnValue = dcWaitForPrompt(ScriptHandle, 1, "User Name: ", 300L, 32000L);
  34.  
  35.     /* Get User Name value from Runtime Values dialog box */
  36.     if (ReturnValue >= 0)
  37.         ReturnValue = dcGetRuntimeValue(ScriptHandle, 1, 1, 128, Buffer);
  38.  
  39.     /* Type the value */
  40.     if (ReturnValue >= 0)
  41.         ReturnValue = dcTypeText(ScriptHandle, 0, Buffer);
  42.  
  43.     /* Wait for a prompt */
  44.     if (ReturnValue >= 0)
  45.         ReturnValue = dcWaitForPrompt(ScriptHandle, 1, "assword:", 300L, 32000L);
  46.  
  47.     /* Get Password value from Runtime Values dialog box */
  48.     if (ReturnValue >= 0)
  49.         ReturnValue = dcGetRuntimeValue(ScriptHandle, 3, 1, 128, Buffer);
  50.  
  51.     /* Type the value */
  52.     if (ReturnValue >= 0)
  53.         ReturnValue = dcTypeText(ScriptHandle, 0, Buffer);
  54.  
  55.     /* Terminate link between Delrina WinComm PRO and script program */
  56.     dcTerminate(ScriptHandle, 0);
  57.     }
  58.  
  59.